package com.itheima.method;
//方法的调用
//提高代码的复用率,降低代码的冗余
//方法不调用,不执行
//各个方法之间是平级的关系,不能嵌套
public class Demo1 {
    public static void main(String[] args) {
        printmsg(5,"HelloWord");
        System.out.println();
        printmsg(7,"HelloJava");


    }

    public static void printmsg(int num,String msg) {
        for(int i=0;i<num;i++){
            System.out.print(msg+" ");
        }

    }
}
